EmergencyPlanView=Ext.extend(Ext.Panel,{
    constructor:function(a){
       Ext.apply(this,a); 
       var all=this.initUIComponents();
       EmergencyPlanView.superclass.constructor.call(this,{
           id:"EmergencyPlanView",
           title:"应急演练",
           layout:'border',
           border:'false',
           region:'center',
           iconCls : "menu-position",
           items : [all.yearGridPanel,all.yearGridSearchPanel,all.yearGridTreePanel]
       })
    },
    initUIComponents:function(){
        var yearGridComponents=new createyeargridview({
            topbar : {
                inputFormName : 'EmergencyPlanForm',
                topbarAdd:{
                    hidden:false
                },
                topbarDel:{
                    hidden:false
                }
            },
            search : {
                items : [ {
                    style : "margin:5px 5px 5px 5px;",
                    text : "预案编号"
                }, {
                    columnWidth : 0.2,
                    xtype : "textfield",
                    name : "Q_instilNo_S_LK",
                    maxLength : 256
                } ]
            },
            grid : {
                title : "应急演练列表",
                rowActions:true,
                listUrl : __ctxPath + "/emergency/listEmergencyPlan.do",
                removeUrl : __ctxPath + "/emergency/deleteEmergencyPlan.do",
                fields : [ "id", 'years','institution','exerciseTheme', "exerciseMode", "exercisePlance", "exerciseTimeDate","exerciseFunds","exerciseOrgainzer","exercisePeople"],
                columns : [ {
                    header : "id",
                    dataIndex : "id",
                    hidden : true
                }, {
                    header : "年份",
                    dataIndex : "years",
                    width : 50,
                    hidden:true,
                    sortable : true
                }, {
                    header:"所属机构",
                    dataIndex:'institution',
                    width:100
                },{
                    header : "演练主题",
                    dataIndex : "exerciseTheme",
                    width : 100
                }, {
                    header : "演练方式",
                    dataIndex : "exerciseMode",
                    width : 70
                }, {
                    header : "演练地点",
                    dataIndex : "exercisePlance",
                    width : 100
                }, {
                    header:"演练时间",
                    dataIndex:"exerciseTimeDate",
                    width:100
                }, {
                    header : "演练经费",
                    dataIndex : "exerciseFunds",
                    width : 70
                },{
                    header:"演练组织者",
                    dataIndex:"exerciseOrgainzer",
                    width:70
                }/*,{
                    header:"演练人员",
                    dataIndex:"exercisePeople",
                    width:70
                }*/,{
                    header:'评审信息',
                    dataIndex:'emgExerciseReviewId',
                    sortable:false,
                    width:50,
                    renderer:function(value,metadata,record,rowIndex,colIndex){
                        var cfg={
                                exerciseId:record.data.id,
                                exerciseTheme:record.data.exerciseTheme
                        }
                        var k = "";
                        k += '<button title="评审" value="" class="btn-showDetail" onclick=\'EmergencyPlanView.pingShenXinXi('
                            + JSON.stringify(cfg) + ')\'></button>';
                        return k;
                    }
                }]
            },
            tree : {
                treeUrl : __ctxPath + "/emergency/treeLoadEmergencyPlan.do"
            }
        });
        return yearGridComponents;
    }
});

EmergencyPlanView.pingShenXinXi=function(exercise){
    new EmergencyPlanReviewWindow({
        exerciseId : exercise.exerciseId,
        exerciseTheme: exercise.exerciseTheme
    }).show();
}